var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
function zsq(target) {
    target.prototype.age = 22;
}
var Student = (function () {
    function Student() {
        this.name = '小王';
    }
    Student.prototype.shwo = function () {
    };
    Student = __decorate([
        zsq
    ], Student);
    return Student;
}());
var stu = new Student();
function zsq2(param) {
    return function iszsq(target) {
        target.prototype.name = '我是工厂装饰器';
    };
}
var Student2 = (function () {
    function Student2() {
        this.ahe = 22;
    }
    Student2 = __decorate([
        zsq2('修饰')
    ], Student2);
    return Student2;
}());
var stu2 = new Student2();
function shuXin(param) {
    return function fun(vm, prototype) {
        vm[prototype] = param;
        vm.age = 26;
    };
}
var Student3 = (function () {
    function Student3() {
    }
    __decorate([
        shuXin(20)
    ], Student3.prototype, "age", void 0);
    return Student3;
}());
var stu3 = new Student3();
console.log(stu3.age);
function fangfa(param) {
    return function (vm, method, descriptor) {
        var oldfun = descriptor.value;
        descriptor.value = function () {
            var args = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                args[_i] = arguments[_i];
            }
            oldfun.call(this);
            console.log(args);
        };
    };
}
var Student4 = (function () {
    function Student4() {
    }
    Student4.prototype.show = function () {
        console.log('方法');
    };
    __decorate([
        fangfa(20)
    ], Student4.prototype, "show", null);
    return Student4;
}());
var stu4 = new Student4();
console.log(stu4.show(1, 2, 3));
